package com.bank.common.exception;

/**
 * Function: 全局异常类. <br/>
 * date: 2018年7月11日 下午2:34:54 <br/>
 * 
 * @author zach
 * @since JDK 1.8
 */
public class GlobalException extends RuntimeException {
	private static final long serialVersionUID = -5701182284190108797L;

	private int code =500;

	public void setCode(int code) {
		this.code = code;
	}

	public int getCode() {
		return code;
	}

	public GlobalException(GlobalException e) {
		this.code = e.getCode();
	}

	/**
	 * @param message 原异常信息
	 */
	public GlobalException(String message) {
		super(message);
	}


	public GlobalException( int code,String message) {
		super(message);
		this.code = code;
	}

	public GlobalException( ErrorCode errorCode) {
		super(errorCode.getErrMsg());
		this.code = errorCode.getErrCode();
	}


}
